<template>
	<view class="cl-ad__wrap">
		<!-- <ad-rewarded-video ref="adRewardedVideo" :urlCallback="{
			userId:2
		}" :adpid="adpid" :loadnext="true" v-slot:default="{loading, error}" @load="rewardedLoad" @close="rewardedClose"
			@error="rewardedError">
		</ad-rewarded-video> -->
	</view>
</template>

<script lang="ts">
	import { defineComponent, ref } from "vue";
	import { rewardedLoad, rewardedClose, rewardedError, rewardedLoading } from "/@/cool/utils";
	export default defineComponent({
		name: "cl-ad-rewarded",

		setup() {
			// #ifdef APP
			const adpid = ref('1279462821')
			// #endif
			// #ifdef MP-WEIXIN
			const adpid = ref('1087224695')
			// #endif
			const adRewardedVideo = ref()
			// 显示广告
			function showAd() {
				if (rewardedLoading.value) {
					return
				}
				adRewardedVideo.value.show();
			}
			return {
				adRewardedVideo,
				showAd,
				rewardedLoad,
				rewardedClose,
				rewardedError,
				adpid
			};
		},
	});
</script>